<?php

// 管理后台
Route::group(['prefix' => 'admin'], function () {
    Route::any('/', 'Admin\AdminController@index');
    Route::any('admin/index', 'Admin\AdminController@index');
    Route::any('admin/login', 'Admin\AdminController@login');
    Route::any('admin/logout', 'Admin\AdminController@logout');
    Route::any('admin/editPwd', 'Admin\AdminController@editPwd');

    Route::any('agent/index', 'Admin\AgentController@index');
    Route::any('agent/add', 'Admin\AgentController@add');
    Route::any('agent/edit', 'Admin\AgentController@edit');
    Route::any('agent/del', 'Admin\AgentController@del');
    Route::any('agent/resetPwd', 'Admin\AgentController@resetPwd');

    Route::any('goods/index', 'Admin\GoodsController@index');
    Route::any('goods/getGoodsByAgentId', 'Admin\GoodsController@getGoodsByAgentId');

    Route::any('order/index', 'Admin\OrderController@index');
    Route::any('order/detail', 'Admin\OrderController@detail');
    Route::any('order/finance', 'Admin\OrderController@finance');

    Route::any('banner/index', 'Admin\BannerController@index');
    Route::any('banner/add', 'Admin\BannerController@add');
    Route::any('banner/edit', 'Admin\BannerController@edit');
    Route::any('banner/del', 'Admin\BannerController@del');

    Route::any('homeBanner/index', 'Admin\HomeBannerController@index');
    Route::any('homeBanner/add', 'Admin\HomeBannerController@add');
    Route::any('homeBanner/edit', 'Admin\HomeBannerController@edit');
    Route::any('homeBanner/del', 'Admin\HomeBannerController@del');

    Route::any('homeModule/index', 'Admin\HomeModuleController@index');
    Route::any('homeModule/add', 'Admin\HomeModuleController@add');
    Route::any('homeModule/edit', 'Admin\HomeModuleController@edit');
    Route::any('homeModule/del', 'Admin\HomeModuleController@del');

    Route::any('homeItem/index', 'Admin\HomeItemController@index');
    Route::any('homeItem/add', 'Admin\HomeItemController@add');
    Route::any('homeItem/edit', 'Admin\HomeItemController@edit');
    Route::any('homeItem/del', 'Admin\HomeItemController@del');
});

// 代理商管理后台
Route::group(['prefix' => 'agent'], function () {
    Route::any('/', 'Agent\AgentController@index');
    Route::any('agent/index', 'Agent\AgentController@index');
    Route::any('agent/login', 'Agent\AgentController@login');
    Route::any('agent/logout', 'Agent\AgentController@logout');
    Route::any('agent/info', 'Agent\AgentController@info');
    Route::any('agent/editPwd', 'Agent\AgentController@editPwd');

    Route::any('supplier/index', 'Agent\SupplierController@index');
    Route::any('supplier/add', 'Agent\SupplierController@add');
    Route::any('supplier/edit', 'Agent\SupplierController@edit');

    Route::any('banner/index', 'Agent\BannerController@index');
    Route::any('banner/add', 'Agent\BannerController@add');
    Route::any('banner/edit', 'Agent\BannerController@edit');
    Route::any('banner/del', 'Agent\BannerController@del');

    Route::any('cate/index', 'Agent\CateController@index');
    Route::any('cate/add', 'Agent\CateController@add');
    Route::any('cate/edit', 'Agent\CateController@edit');

    Route::any('goods/index', 'Agent\GoodsController@index');
    Route::any('goods/add', 'Agent\GoodsController@add');
    Route::any('goods/edit', 'Agent\GoodsController@edit');
    Route::any('goods/changeStatus', 'Agent\GoodsController@changeStatus');

    Route::any('order/index', 'Agent\OrderController@index');
    Route::any('order/detail', 'Agent\OrderController@detail');
    Route::any('order/saveExpressNum', 'Agent\OrderController@saveExpressNum');
    Route::any('order/finance', 'Agent\OrderController@finance');
});

Route::group(['prefix' => 'api'], function () {
    Route::any('upload/image', 'Api\UploadController@image');
    Route::any('area/getProvinces', 'Api\AreaController@getProvinces');
    Route::any('area/getCityList', 'Api\AreaController@getCityList');
});

Route::group(['middleware' => ['subDomain']], function () {
    Route::any('/', 'Home\HomeController@index');
    Route::any('goods', 'Home\HomeController@goods');
    Route::any('detail', 'Home\HomeController@detail');
    Route::any('login', 'Home\HomeController@login');
    Route::any('logout', 'Home\HomeController@logout');
    Route::any('register', 'Home\HomeController@register');
    Route::any('home/home/sendSmsCode', 'Home\HomeController@sendSmsCode');
    Route::any('home/home/search', 'Home\HomeController@search');

    Route::any('home/user/index', 'Home\UserController@index');
    Route::any('home/user/profile', 'Home\UserController@profile');
    Route::any('home/user/changeName', 'Home\UserController@changeName');
    Route::any('home/user/changeInfo', 'Home\UserController@changeInfo');
    Route::any('home/user/userSet', 'Home\UserController@userSet');
    Route::any('home/user/changePwd', 'Home\UserController@changePwd');
    Route::any('home/user/addressList', 'Home\UserController@addressList');
    Route::any('home/user/address', 'Home\UserController@address');
    Route::any('home/user/addressSet', 'Home\UserController@addressSet');
    Route::any('home/user/addressDel', 'Home\UserController@addressDel');

    Route::any('home/order/index', 'Home\OrderController@index');
    Route::any('home/order/cart', 'Home\OrderController@cart');
    Route::any('home/order/getCartGoods', 'Home\OrderController@getCartGoods');
    Route::any('home/order/confirmOrder', 'Home\OrderController@confirmOrder');
    Route::any('home/order/wxPayNotify', 'Home\OrderController@wxPayNotify');
    Route::any('home/order/unifiedOrder', 'Home\OrderController@unifiedOrder');
    Route::any('home/order/del', 'Home\OrderController@del');
});

Route::any('newHome', 'Home\HomeController@newHome');
Route::any('demo/demo/index', 'Demo\DemoController@index');
